package com.ton.common.entity;


import com.kypj.frame.db.annotation.MyPk;
import lombok.Data;

import java.util.Date;

/**
 * Tron账户实体类
 */
@Data
public class TronAccount {
    //id
    @MyPk
    private Long id;

    //地址
    private String address;

    //私钥     Private key
    private String privateKey;

    //trx余额
    private Long balanceTrx;

    //trc20余额
    private Long balanceTrc20;

    //创建时间
    private Date createDate;

    //是否可复用(0=否 1=是)
    private Integer isReuse;

    //是否在订单流程(0=否 1=是)
    private Integer isOrderFlow;

    //是否是主账户(-1|null 非主账户 1=TRX 2=TRC)
    private Integer mainType;

    //备注
    private String remark;

    private Long residueEnergy; //剩余能量

    public TronAccount(String address, String privateKey, Long balanceTrx,Long balanceTrc20, Integer isReuse, Integer isOrderFlow,Integer mainType) {
        this.address = address; //地址
        this.privateKey = privateKey; //私钥
        this.balanceTrx = balanceTrx; //trx余额
        this.balanceTrc20 = balanceTrc20; //trc20余额
        this.createDate = new Date(); //创建时间
        this.isReuse = isReuse; //是否可复用
        this.isOrderFlow = isOrderFlow; //是否在走流程
        this.mainType = mainType; //是否是主账户(-1|null 非主账户 1=TRX 2=TRC)
        this.remark="";
        this.residueEnergy = 0L;
    }

    public TronAccount(Long id, String address, String privateKey, Long balanceTrx,Long balanceTrc20, Date createDate, Integer isReuse, Integer isOrderFlow,Integer mainType,String remark) {
        this.id = id;
        this.address = address;
        this.privateKey = privateKey;
        this.balanceTrx = balanceTrx;
        this.balanceTrc20 = balanceTrc20;
        this.createDate = createDate;
        this.isReuse = isReuse;
        this.isOrderFlow = isOrderFlow;
        this.mainType = mainType;
        this.remark = remark;
        this.residueEnergy = 0L;
    }

    public TronAccount() {
    }
}
